package com.atguigu.guli.service.base.exception;

import com.atguigu.guli.service.base.result.ResultCodeEnum;
import lombok.Getter;

@Getter
public class GuliException extends RuntimeException {
    private Integer code;

    public GuliException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public GuliException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();

    }
    public GuliException(ResultCodeEnum codeEnum,Exception e){
        super(e);
        this.code = codeEnum.getCode();
    }

    @Override
    public String toString() {
        return "GuliException{" +
                "code=" + code +
                '}';
    }
}
